package demo.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import demo.dao.MissionEnclosureMapper;
import demo.entity.MissionEnclosure;
import demo.service.MissionEnclosureService;

@Service
public class MissionEnclosureServiceImpl implements MissionEnclosureService{

	@Resource
	private MissionEnclosureMapper mem;
	@Override
	public boolean addMissionEnclosure(MissionEnclosure missionEnclosure) {
		// TODO Auto-generated method stub
		boolean flag=false;
		if(mem.insertSelective(missionEnclosure)>0) {
			flag=true;
		}
		return flag;
	}

	@Override
	public boolean updateMissionEnclosure(MissionEnclosure missionEnclosure) {
		// TODO Auto-generated method stub
		boolean flag=false;
		if(mem.updateByPrimaryKeySelective(missionEnclosure)>0) {
			flag=true;
		}
		return flag;
	}

	@Override
	public boolean delete(Integer id) {
		// TODO Auto-generated method stub
		boolean flag=false;
		if(mem.deleteByPrimaryKey(id)>0) {
			flag=true;
		}
		return flag;
	}

	@Override
	public MissionEnclosure getById(Integer id) {
		// TODO Auto-generated method stub
		return mem.selectByPrimaryKey(id);
	}

	@Override
	public List<MissionEnclosure> getBySuperioridAndSendid(Integer superiorid, Integer sendid) {
		// TODO Auto-generated method stub
		return mem.findBySuperioridAndSendid(superiorid, sendid);
	}

	@Override
	public MissionEnclosure getBySuperiorid(Integer superiorid) {
		// TODO Auto-generated method stub
		return mem.findBySuperiorid(superiorid);
	}

}
